function greeter(person:string) {
  return "Hello, " + person;
}

let user = "Jane User";
let users = [1,2,3];

document.body.textContent = greeter(user);


/**
 * 接口
 */
interface Person {
  firstName: string;
  lastName: string;
}

function greeterTo1(person: Person) {
  return "Hello, " + person.firstName + " " + person.lastName;
}

let userTo1 = { firstName: "Jane", lastName: "User" };

document.body.textContent = greeterTo1(userTo1);

/**
 * 类
 */
class Student{
  fullName:string;
  constructor(
    public firstName:string,
    public middleInitial:string,
    public lastName:string
  ){
    this.fullName = firstName + "" +middleInitial + " " +lastName;
  }
}


function greeterTo2(person:Person){
  return "Hello, " + person.firstName + " " + person.lastName;
}

let userTo2 = new Student("Jane", "M.", "User");

document.body.textContent = greeterTo2(userTo2);